
What does the Eurodollar market tell us about the effects of credit shocks and monetary policy?  MATLAB file

1. Evaluating the models  

Unzip the directory and type test in the command window to get the results for the preferred model M5. Type plotmodel to plot the state variables and to compare estimated yield variables with their observed values. 
Other models can be run by replacing the getLoglikeliHood_kf.m and loadp.m Other models files with the appropriate files shown in this table: 

Model	getLoglikeliHood_kf			loadp
				
M2	getLoglikeliHood_M2			loadp_M2
M3	getLoglikeliHood_M3			loadp_M3
M4	getLoglikeliHood_M4			loadp_M4
M5	getLoglikeliHood_M5			loadp_M5


You can run other term structure models the models as follows:

1. Estimating a term-structure model 
(a) Input starting values in the loadp.m file and then save the file. For example you input the following in the loadp.m file:
p=[
0.1 1
0.1 1
0.1 1


0.1 1
0.1 1
] 

The first column of p stores the starting values and second column of p stores the estimation sequence index (input 1 for every parameter to be estimated if you want to estimate them all at the same time). 
You can find the example starting value matrix in the dataparaus.xls file. Zero for excluded or restricted parameters.

The reported values for models 0 and 1 are stored in loadpmodel0.m and loadpmodel0.m files

1. (b) In the command window input test to evaluate the model or main to estimate it and press ENTER. The final estimated parameters are stored in p and the loglikelihood is stored in loglh, both in workspace.

2. Ensure that all the files are in the current directory of matlab [shown in top right dialogue box.
3. Press Contrl+Break whenever you want to stop the program. However, this will only return updated parameter values etc if the program has been running for some time.  

1.2 How to get the estimated model
Open loadp.m file and enter the estimated p matrix. Then input test in the command window to obtain the estimated model. 

Input plotmodel in the command window to compare estimated yield or macro variables with their true values. The estimated state variables are stored in Zhat matrix; estimated macro and yield variables in Yhat matrix.
